//
//  MainViewController.swift
//  JJWQ
//
//  Created by Mac on 2016/11/8.
//  Copyright © 2016年 tyw. All rights reserved.
//

import UIKit

class JJWQMainVC: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        tabBar.tintColor = UIColor.blue
        addChildViewControllers()
        
    }

    private func addChildViewControllers()
    {
        addChildViewController(childController: JJWQHomeVC(), title: "首页", imageName: "tabbar_home")
        addChildViewController(childController: JJWQDynamicVC(), title: "动态", imageName: "tabbar_dynamic")
        addChildViewController(childController: JJWQDiscoveryVC(), title: "发现", imageName: "tabbar_found")
        addChildViewController(childController: JJWQDataCenterVC(), title: "数据", imageName: "tabbar_data")
        addChildViewController(childController: MineVC(), title: "我的", imageName: "tabbar_mine")
    }
  
    private func addChildViewController(childController: UIViewController, title: String, imageName: String)
    {
        childController.title = title;
        childController.tabBarItem.image = UIImage(named: imageName)
//        childController.tabBarItem.selectedImage = UIImage(named: imageName + "_highlighted")
        let naV = UINavigationController(rootViewController: childController)
        addChildViewController(naV)
        
    }
}
